import java.util.concurrent.locks.ReentrantLock;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-09-06
 * Time: 15:38
 */
public class main {
    public static void main(String[] args) throws InterruptedException {
        //构造一个新线程
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 200; i++) {
                    System.out.println("这是第一个线程！");
                }
            }
        });

        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 200; i++) {
                    System.out.println("这是第二个线程！");
                }
            }
        });
        
        System.out.println("线程1启动");
        //启动新线程
        t1.start();
        System.out.println("线程2启动");
        t2.start();

        System.out.println(t1.getState());
        System.out.println(t2.getState());
    }
}
